{extend name='public/_home' /}

{block name='title'}系统设置{/block}

{block name='main'}
<!-- Page Content -->
<div class="page-content">
    <!-- Page Breadcrumb -->
    <div class="page-breadcrumbs">
        <ul class="breadcrumb">
            <li class="active">
                <i class="fa fa-home"></i>&nbsp;系统设置
            </li>
        </ul>
    </div>
    <!-- /Page Breadcrumb -->
    <!-- Page Body -->
    <div class="page-body">
        <div class="row">
            <div class="col-xs-12">
                <div class="widget radius-bordered">
                    <div class="widget-header bordered-bottom bordered-themeprimary">
                        <span class="widget-caption">系统设置</span>
                    </div>
                    <div class="widget-body">
                        <form class="form-horizontal">
                            <div class="form-group">
                                <label for="webname" class="col-sm-2 control-label no-padding-right">网站名称</label>
                                <div class="col-sm-6">
                                    <input type="text" class="form-control" id="webname" name="webname" value="{$systems.webname}" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="copyright" class="col-sm-2 control-label no-padding-right">版权</label>
                                <div class="col-sm-6">
                                    <input type="text" class="form-control" id="copyright" name="copyright" value="{$systems.copyright}" />
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <button type="submit" class="btn btn-primary" id="cateUpdate">更新</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- /Page Body -->
</div>
<!-- /Page Content -->
{/block}

{block name="js"}
<script>
    $(function () {
        $('#cateUpdate').click(function () {
            $.ajax({
                url: "{:url('admin/system/edit')}",
                type: "post",
                data: $("form").serialize(),
                dataType: "json",
                success: function (data) {
                    if (data.code == 1) {
                        layer.msg(data.msg, {
                            icon: 6,
                            time: 2000
                        }, function () {
                            location.href = data.url
                        })
                    } else {
                        layer.open({
                            title: "操作失败",
                            icon: 5,
                            content: data.msg
                        })
                    }
                }
            })
            return false;
        });
    });
</script>
{/block}